package com.nali.spreader.dao.impl;

import com.nali.spreader.dao.ICrudAccountLogDao;
import com.nali.spreader.data.AccountLog;
import com.nali.spreader.data.AccountLogExample;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class CrudAccountLogDao implements ICrudAccountLogDao {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 11:14:29 CST 2013
     */
    public CrudAccountLogDao() {
        super();
    }

    /**
     * This field was generated by Apache iBATIS ibator.
     * This field corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    @Autowired
    private SqlMapClientTemplate sqlMap;

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int countByExample(AccountLogExample example) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("spreader_tb_account_log.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int deleteByExample(AccountLogExample example) {
        int rows = getSqlMapClientTemplate().delete("spreader_tb_account_log.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int deleteByPrimaryKey(Long id) {
        AccountLog key = new AccountLog();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("spreader_tb_account_log.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public Long insert(AccountLog record) {
        Object newKey = getSqlMapClientTemplate().insert("spreader_tb_account_log.ibatorgenerated_insert", record);
        return (Long) newKey;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public Long insertSelective(AccountLog record) {
        Object newKey = getSqlMapClientTemplate().insert("spreader_tb_account_log.ibatorgenerated_insertSelective", record);
        return (Long) newKey;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    @SuppressWarnings("unchecked")
    public List<AccountLog> selectByExample(AccountLogExample example) {
        List<AccountLog> list = getSqlMapClientTemplate().queryForList("spreader_tb_account_log.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public AccountLog selectByPrimaryKey(Long id) {
        AccountLog key = new AccountLog();
        key.setId(id);
        AccountLog record = (AccountLog) getSqlMapClientTemplate().queryForObject("spreader_tb_account_log.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int updateByExampleSelective(AccountLog record, AccountLogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_account_log.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int updateByExample(AccountLog record, AccountLogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_account_log.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int updateByPrimaryKeySelective(AccountLog record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_account_log.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public int updateByPrimaryKey(AccountLog record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_account_log.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    public SqlMapClientTemplate getSqlMapClientTemplate() {
        return sqlMap;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table spreader.tb_account_log
     *
     * @ibatorgenerated Thu Feb 21 13:45:38 CST 2013
     */
    private static class UpdateByExampleParms extends AccountLogExample {

        private Object record;

        public UpdateByExampleParms(Object record, AccountLogExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}
